<script type="text/javascript" src="<?=BASE_URL()?>java_scripts/vote_scripts.js"></script>
<div>
<?php 
	$error_msg=(!isset($error))?"":$error;
?>
   <table border="0" width="100%">
      <tr>
      	<td style="font-size: 20px;font-weight: bold;">Update - Vote Item Category</td>
      </tr>
      <tr>
      	<td align="center">
	      	<form action="" method="post">
	      		<?php 
	      			foreach($categories->result_array() as $category){
	      			$id=(!isset($error))?$category['vote_item_cat_id']:$cat_id;
	      			$desc=(!isset($error))?$category['vote_item_cat_desc']:$cat_desc;
	      		?>
	      		<table border="0" cellpadding="0" cellspacing="0" width="80%">
	      			<tr align="center">
	      				<td height="55">
	      				<input type="hidden" name="txtcatid" value="<?=$id?>">
	      				Category Name :&nbsp;&nbsp;&nbsp;<input type="text" name="txtcat" id="txtcat" value="<?=$desc?>" maxlength="255" style="width: 250px;" /><div id='existing'><?=$error_msg?></div>
	      				</td>
	      			</tr>
	      			<tr align="center">
	      				<td height="20"><input type="button" onclick="javascript:window.location='<?=site_url("vote_management/itemCategory")?>'" style="cursor: pointer;" value="Back"/>&nbsp;&nbsp;<input type="button" onclick="javascript:updateCategory('<?=site_url("vote_management/updateCategory")?>')" style="cursor: pointer;" value="Update"/></td>
	      			</tr>
	      		</table>
	      		<?php 
	      			}
	      		?>
	      	</form>
      	</td>
      </tr>
   </table>
</div>
